<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app" @click = 'dd' >
        <button ref = 'aa' >dsdssds</button>
        <demo ref="ss" >
            dsds
        </demo>
    </div>
    <script src="js/vue.js"></script>
    <!-- <script>
        var vm = new Vue({
            template:`<div>hello vue</div>`,
        }).$mount('#app')
        console.log(Vue.compile(`<div>hello vue</div>`).render)
    </script> -->
    <script>
        const demo = {
            template: `<div ref = "dd" ><span>dsds</span></div>`,
        }

        var vm = new Vue({
            el: '#app',
            components: {
                demo
            },
            methods: {
                dd(){
                    console.log(this.$refs.ss);
                    this.$refs.aa.innerText = 'aaa'
                }
            }
        })
    </script>
</body>

</html>